package cz.muni.fi.pa165.sme.services.converter;

import cz.muni.fi.pa165.sme.api.to.SportActivityTO;
import cz.muni.fi.pa165.sme.dao.entity.SportActivity;
import org.springframework.core.convert.converter.Converter;

/**
 * @author Martin Novak
 */
public class SportActivity2SportActivityTOConverter implements Converter<SportActivity, SportActivityTO> {
	@Override
	public SportActivityTO convert(final SportActivity source) {
            if(source == null) {
                    return null;
            }

            final SportActivityTO target = new SportActivityTO();

            target.setId(source.getId());
            target.setSpeed(source.getSpeed());
            target.setTitle(source.getTitle());

            return target;
	}
}
